home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 #2 / Ham Radio 2000 - Volume 2.iso / HAMV2 / TCP_IP / TNOS230S / DIRUTIL.H < prev    next >
Encoding:
C/C++ Source or Header  |  1997-05-24  |  2.1 KB  |  82 lines

  1. #ifndef _DIRUTIL_H
  2. #define _DIRUTIL_H
  3.  
  4. #ifndef _GLOBAL_H
  5. #include "global.h"
  6. #endif
  7.  
  8. #ifdef UNIX
  9. #ifndef _TIME_H
  10. #include <time.h>
  11. #endif
  12.  
  13. #if !defined(_DIRENT_H) && !defined(__dj_include_dirent_h_)
  14. #include <dirent.h>
  15. #endif
  16.  
  17. struct ffblk
  18. {
  19.     char ff_name[256];        /* current filename result */
  20.     struct tm ff_ftime;        /* modify date/time */
  21.     long ff_fsize;        /* file size */
  22.     int ff_attrib;        /* DOS-style attributes (ugh) */
  23.     /* ...only visible to internals... */
  24.     char *ff_pfx;        /* prefix for found patterns */
  25.     char *ff_pat;        /* pattern for the current level */
  26.     DIR *ff_dir;        /* directory scan for the current level */
  27.     struct dirent *ff_cur;    /* current path component */
  28.     long ff_sattr;        /* selected attributes */
  29. };
  30.  
  31. #define FA_NORMAL    0    /* anything except the following: */
  32. #define FA_SYSTEM    1    /* device node or unreadable file */
  33. #define FA_HIDDEN    2    /* dot-files */
  34. #define FA_DIREC    4    /* directory */
  35. #define FA_RDONLY    8    /* read-only file */
  36.  
  37. extern int findfirst (const char *pat, struct ffblk *ff, int attr);
  38. extern int findnext (struct ffblk *ff);
  39. #if 0
  40. extern void findlast (struct ffblk *ff);
  41. #endif
  42. #endif
  43.  
  44. #ifdef MSDOS
  45. # ifndef __dj_include_dir_h_
  46. #  include <dir.h>
  47. # endif
  48. # ifndef __dj_include_dos_h_
  49. #  include <dos.h>
  50. # endif
  51. #endif
  52.  
  53. struct cur_dirs {
  54. #if !defined(TNOS_68K) && !defined(UNIX)
  55.            int drv;
  56.            char * curdir[27];
  57. #endif
  58.            char const * dir;                
  59. };    /*lint !e770 */
  60.  
  61. /* In dirutil.c */
  62. extern FILE *dir (char *path,int full);
  63. extern int filedir (const char *name,int times,char *ret_str);
  64. extern int getdir (char const *path,int full,FILE *file);
  65. extern void undosify (char *s);
  66. extern char * make_dir_path (int count,char *arg,const char* curdir);
  67. extern char * make_fname (const char * curdir, const char * fname);
  68. extern const char * init_dirs (struct cur_dirs * dirs);
  69. extern void free_dirs (struct cur_dirs * dirs);
  70. extern int dir_ok (char * path,struct cur_dirs * dirs);
  71.  
  72.  
  73. /* In pathname.c: */
  74. char *pathname (const char *cd,const char *path);
  75.  
  76. /* In bmutil.c */
  77. long fsize (char *name);
  78.  
  79. #endif /* _DIRUTIL_H */
  80.  
  81.  
  82.